Fixed some bugs with set_default_size.
authorOwen Taylor <otaylor@redhat.com>
Wed, 10 Feb 1999 02:35:09 +0000 (02:35 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 10 Feb 1999 02:35:09 +0000 (02:35 +0000)
Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>

* gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
  bugs with set_default_size.

Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>

* docs/Changes-1.2.txt: Added information about
 the change to gtk_widget_size_request().

* gtk/gtkentry.c: Call gtk_widget_get_child_requisition
 explicitely since we differentiate between the usize
 set by the user and what we got. (Ugh)

* gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
 New function to return the effective size of a widget
 as it looks to its parent.

* gtk/gtkwidget.c (gtk_widget_size_request): Leave
 widget->requisition set to exactly what the widget
 asked for, and then make a copy of that into
 the requisition argument. Allow a NULL requisition
 argument, and, if G_ENABLE_DEBUG, warn if
 requisition == &widget->requisition.

* gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
  gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
  gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c
  gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
  gtkmenubar.c gtkmenuitem.c gtknotebook.c
  gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
  gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
  gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c

 Avoid calling gtk_widget_size_request with
 requisition == widget->requisition; use
 gtk_widget_get_child_requisition to get the
 size of children.

44 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/Changes-1.2.txt
gtk/gtkalignment.c
gtk/gtkaspectframe.c
gtk/gtkbutton.c
gtk/gtkclist.c
gtk/gtkcontainer.c
gtk/gtkentry.c
gtk/gtkeventbox.c
gtk/gtkfixed.c
gtk/gtkframe.c
gtk/gtkhandlebox.c
gtk/gtkhandlebox.h
gtk/gtkhbox.c
gtk/gtkhpaned.c
gtk/gtklayout.c
gtk/gtklist.c
gtk/gtklistitem.c
gtk/gtkmenu.c
gtk/gtkmenubar.c
gtk/gtkmenuitem.c
gtk/gtknotebook.c
gtk/gtkoptionmenu.c
gtk/gtkpacker.c
gtk/gtkscrolledwindow.c
gtk/gtksocket.c
gtk/gtktable.c
gtk/gtktoolbar.c
gtk/gtktree.c
gtk/gtktreeitem.c
gtk/gtkvbox.c
gtk/gtkviewport.c
gtk/gtkvpaned.c
gtk/gtkwidget.c
gtk/gtkwidget.h
gtk/gtkwindow.c
gtk/testgtk.c
tests/testgtk.c

index b7b63f06857706c99f664c019211cedd098232f9..fb61ad7d332edb35a46fcce9985ea4b30907af15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
+         bugs with set_default_size.
+
+Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * docs/Changes-1.2.txt: Added information about
+        the change to gtk_widget_size_request().
+
+       * gtk/gtkentry.c: Call gtk_widget_get_child_requisition
+        explicitely since we differentiate between the usize
+        set by the user and what we got. (Ugh)
+
+       * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
+        New function to return the effective size of a widget
+        as it looks to its parent.
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): Leave
+        widget->requisition set to exactly what the widget
+        asked for, and then make a copy of that into
+        the requisition argument. Allow a NULL requisition
+        argument, and, if G_ENABLE_DEBUG, warn if
+        requisition == &widget->requisition.
+
+       * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
+         gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
+         gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c 
+         gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
+         gtkmenubar.c gtkmenuitem.c gtknotebook.c
+         gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
+         gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
+         gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
+
+        Avoid calling gtk_widget_size_request with
+        requisition == widget->requisition; use 
+        gtk_widget_get_child_requisition to get the
+        size of children.
+
 Tue Feb  9 19:49:46 1999  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in (LDFLAGS): Removed extraneous line
@@ -59,6 +98,7 @@ Mon Feb  8 12:50:06 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * Makefile.am: update to include the latest Tutorial examples.
 
+>>>>>>> 1.1009
 Sat Feb  6 11:20:16 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
index b7b63f06857706c99f664c019211cedd098232f9..fb61ad7d332edb35a46fcce9985ea4b30907af15 100644 (file)
@@ -1,3 +1,42 @@
+Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
+         bugs with set_default_size.
+
+Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * docs/Changes-1.2.txt: Added information about
+        the change to gtk_widget_size_request().
+
+       * gtk/gtkentry.c: Call gtk_widget_get_child_requisition
+        explicitely since we differentiate between the usize
+        set by the user and what we got. (Ugh)
+
+       * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
+        New function to return the effective size of a widget
+        as it looks to its parent.
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): Leave
+        widget->requisition set to exactly what the widget
+        asked for, and then make a copy of that into
+        the requisition argument. Allow a NULL requisition
+        argument, and, if G_ENABLE_DEBUG, warn if
+        requisition == &widget->requisition.
+
+       * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
+         gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
+         gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c 
+         gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
+         gtkmenubar.c gtkmenuitem.c gtknotebook.c
+         gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
+         gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
+         gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
+
+        Avoid calling gtk_widget_size_request with
+        requisition == widget->requisition; use 
+        gtk_widget_get_child_requisition to get the
+        size of children.
+
 Tue Feb  9 19:49:46 1999  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in (LDFLAGS): Removed extraneous line
@@ -59,6 +98,7 @@ Mon Feb  8 12:50:06 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * Makefile.am: update to include the latest Tutorial examples.
 
+>>>>>>> 1.1009
 Sat Feb  6 11:20:16 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
index b7b63f06857706c99f664c019211cedd098232f9..fb61ad7d332edb35a46fcce9985ea4b30907af15 100644 (file)
@@ -1,3 +1,42 @@
+Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
+         bugs with set_default_size.
+
+Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * docs/Changes-1.2.txt: Added information about
+        the change to gtk_widget_size_request().
+
+       * gtk/gtkentry.c: Call gtk_widget_get_child_requisition
+        explicitely since we differentiate between the usize
+        set by the user and what we got. (Ugh)
+
+       * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
+        New function to return the effective size of a widget
+        as it looks to its parent.
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): Leave
+        widget->requisition set to exactly what the widget
+        asked for, and then make a copy of that into
+        the requisition argument. Allow a NULL requisition
+        argument, and, if G_ENABLE_DEBUG, warn if
+        requisition == &widget->requisition.
+
+       * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
+         gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
+         gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c 
+         gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
+         gtkmenubar.c gtkmenuitem.c gtknotebook.c
+         gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
+         gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
+         gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
+
+        Avoid calling gtk_widget_size_request with
+        requisition == widget->requisition; use 
+        gtk_widget_get_child_requisition to get the
+        size of children.
+
 Tue Feb  9 19:49:46 1999  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in (LDFLAGS): Removed extraneous line
@@ -59,6 +98,7 @@ Mon Feb  8 12:50:06 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * Makefile.am: update to include the latest Tutorial examples.
 
+>>>>>>> 1.1009
 Sat Feb  6 11:20:16 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
index b7b63f06857706c99f664c019211cedd098232f9..fb61ad7d332edb35a46fcce9985ea4b30907af15 100644 (file)
@@ -1,3 +1,42 @@
+Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
+         bugs with set_default_size.
+
+Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * docs/Changes-1.2.txt: Added information about
+        the change to gtk_widget_size_request().
+
+       * gtk/gtkentry.c: Call gtk_widget_get_child_requisition
+        explicitely since we differentiate between the usize
+        set by the user and what we got. (Ugh)
+
+       * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
+        New function to return the effective size of a widget
+        as it looks to its parent.
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): Leave
+        widget->requisition set to exactly what the widget
+        asked for, and then make a copy of that into
+        the requisition argument. Allow a NULL requisition
+        argument, and, if G_ENABLE_DEBUG, warn if
+        requisition == &widget->requisition.
+
+       * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
+         gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
+         gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c 
+         gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
+         gtkmenubar.c gtkmenuitem.c gtknotebook.c
+         gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
+         gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
+         gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
+
+        Avoid calling gtk_widget_size_request with
+        requisition == widget->requisition; use 
+        gtk_widget_get_child_requisition to get the
+        size of children.
+
 Tue Feb  9 19:49:46 1999  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in (LDFLAGS): Removed extraneous line
@@ -59,6 +98,7 @@ Mon Feb  8 12:50:06 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * Makefile.am: update to include the latest Tutorial examples.
 
+>>>>>>> 1.1009
 Sat Feb  6 11:20:16 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
index b7b63f06857706c99f664c019211cedd098232f9..fb61ad7d332edb35a46fcce9985ea4b30907af15 100644 (file)
@@ -1,3 +1,42 @@
+Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
+         bugs with set_default_size.
+
+Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * docs/Changes-1.2.txt: Added information about
+        the change to gtk_widget_size_request().
+
+       * gtk/gtkentry.c: Call gtk_widget_get_child_requisition
+        explicitely since we differentiate between the usize
+        set by the user and what we got. (Ugh)
+
+       * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
+        New function to return the effective size of a widget
+        as it looks to its parent.
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): Leave
+        widget->requisition set to exactly what the widget
+        asked for, and then make a copy of that into
+        the requisition argument. Allow a NULL requisition
+        argument, and, if G_ENABLE_DEBUG, warn if
+        requisition == &widget->requisition.
+
+       * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
+         gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
+         gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c 
+         gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
+         gtkmenubar.c gtkmenuitem.c gtknotebook.c
+         gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
+         gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
+         gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
+
+        Avoid calling gtk_widget_size_request with
+        requisition == widget->requisition; use 
+        gtk_widget_get_child_requisition to get the
+        size of children.
+
 Tue Feb  9 19:49:46 1999  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in (LDFLAGS): Removed extraneous line
@@ -59,6 +98,7 @@ Mon Feb  8 12:50:06 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * Makefile.am: update to include the latest Tutorial examples.
 
+>>>>>>> 1.1009
 Sat Feb  6 11:20:16 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
index b7b63f06857706c99f664c019211cedd098232f9..fb61ad7d332edb35a46fcce9985ea4b30907af15 100644 (file)
@@ -1,3 +1,42 @@
+Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
+         bugs with set_default_size.
+
+Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * docs/Changes-1.2.txt: Added information about
+        the change to gtk_widget_size_request().
+
+       * gtk/gtkentry.c: Call gtk_widget_get_child_requisition
+        explicitely since we differentiate between the usize
+        set by the user and what we got. (Ugh)
+
+       * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
+        New function to return the effective size of a widget
+        as it looks to its parent.
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): Leave
+        widget->requisition set to exactly what the widget
+        asked for, and then make a copy of that into
+        the requisition argument. Allow a NULL requisition
+        argument, and, if G_ENABLE_DEBUG, warn if
+        requisition == &widget->requisition.
+
+       * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
+         gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
+         gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c 
+         gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
+         gtkmenubar.c gtkmenuitem.c gtknotebook.c
+         gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
+         gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
+         gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
+
+        Avoid calling gtk_widget_size_request with
+        requisition == widget->requisition; use 
+        gtk_widget_get_child_requisition to get the
+        size of children.
+
 Tue Feb  9 19:49:46 1999  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in (LDFLAGS): Removed extraneous line
@@ -59,6 +98,7 @@ Mon Feb  8 12:50:06 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * Makefile.am: update to include the latest Tutorial examples.
 
+>>>>>>> 1.1009
 Sat Feb  6 11:20:16 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
index b7b63f06857706c99f664c019211cedd098232f9..fb61ad7d332edb35a46fcce9985ea4b30907af15 100644 (file)
@@ -1,3 +1,42 @@
+Sun Feb  7 19:49:21 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkwindow.c (gtk_window_move_resize): Fixed some
+         bugs with set_default_size.
+
+Sat Feb  6 13:23:51 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * docs/Changes-1.2.txt: Added information about
+        the change to gtk_widget_size_request().
+
+       * gtk/gtkentry.c: Call gtk_widget_get_child_requisition
+        explicitely since we differentiate between the usize
+        set by the user and what we got. (Ugh)
+
+       * gtk/gtkwidget.[ch] (gtk_widget_get_child_requisition):
+        New function to return the effective size of a widget
+        as it looks to its parent.
+
+       * gtk/gtkwidget.c (gtk_widget_size_request): Leave
+        widget->requisition set to exactly what the widget
+        asked for, and then make a copy of that into
+        the requisition argument. Allow a NULL requisition
+        argument, and, if G_ENABLE_DEBUG, warn if
+        requisition == &widget->requisition.
+
+       * gtkalignment.c gtkaspectframe.c gtkbutton.c gtkclist.c
+         gtkcontainer.c gtkentry.c gtkeventbox.c gtkfixed.c
+         gtkframe.c gtkhandlebox.c gtkhbox.c gtkhpaned.c 
+         gtklayout.c gtklist.c gtklistitem.c gtkmenu.c
+         gtkmenubar.c gtkmenuitem.c gtknotebook.c
+         gtkoptionmenu.c gtkpacker.c gtkscrolledwindow.c
+         gtktable.c gtktoolbar.c gtktree.c gtktreeitem.c
+         gtkvbox.c gtkviewport.c gtkvpaned.c gtkwindow.c
+
+        Avoid calling gtk_widget_size_request with
+        requisition == widget->requisition; use 
+        gtk_widget_get_child_requisition to get the
+        size of children.
+
 Tue Feb  9 19:49:46 1999  Owen Taylor  <otaylor@redhat.com>
 
        * configure.in (LDFLAGS): Removed extraneous line
@@ -59,6 +98,7 @@ Mon Feb  8 12:50:06 GMT 1999 Tony Gale  <gale@gtk.org>
 
        * Makefile.am: update to include the latest Tutorial examples.
 
+>>>>>>> 1.1009
 Sat Feb  6 11:20:16 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_idle_draw): Add the
index 0d452d6831cd015658b87c5d0eabe800edf648ca..1830aa239a6d54268d61b289b329efbb96dba5c5 100644 (file)
@@ -245,3 +245,30 @@ Incompatible Changes from GTK+-1.0 to GTK+-1.2:
      You can get these CFLAGS and LIBS by passing gthread
      as the fourth parameter to the AM_PATH_GTK automake
      macro.
+
+* Prior to GTK+-1.2, there were two conflicting interpretations
+  of widget->requistion. It was either taken to be
+  the size that the widget requested, or that size
+  modified by calls to gtk_widget_set_usize(). In GTK+-1.2,
+  it is always interpreted the first way.
+
+  Container widgets are affected in two ways by this:
+
+   1) Container widgets should not pass widget->requisition
+      as the second parameter to gtk_widget_size_request().
+      Instead they should call it like:
+   
+      GtkRequisition child_requisition;
+      gtk_widget_size_request (widget, &child_requisition);
+
+   2) Container widgets should not access child->requisition
+      directly. Either they should use the values returned
+      by gtk_widget_size_request(), or they should call
+      the new function:
+
+    void gtk_widget_get_child_requisition (GtkWidget      *widget,
+                                          GtkRequisition *requisition);
+
+      which returns the requisition of the given widget, modified
+      by calls to gtk_widget_set_usize().
+
index 77e0656733747f16358a5f150ccb3f37f9e112e7..f8c9bfded8dd4ed4c9218243dc0cce5b99458964 100644 (file)
@@ -241,10 +241,12 @@ gtk_alignment_size_request (GtkWidget      *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
+      GtkRequisition child_requisition;
+      
+      gtk_widget_size_request (bin->child, &child_requisition);
 
-      requisition->width += bin->child->requisition.width;
-      requisition->height += bin->child->requisition.height;
+      requisition->width += child_requisition.width;
+      requisition->height += child_requisition.height;
     }
 }
 
@@ -255,6 +257,7 @@ gtk_alignment_size_allocate (GtkWidget     *widget,
   GtkAlignment *alignment;
   GtkBin *bin;
   GtkAllocation child_allocation;
+  GtkRequisition child_requisition;
   gint width, height;
   gint x, y;
 
@@ -268,20 +271,22 @@ gtk_alignment_size_allocate (GtkWidget     *widget,
   
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
+      gtk_widget_get_child_requisition (bin->child, &child_requisition);
+      
       x = GTK_CONTAINER (alignment)->border_width;
       y = GTK_CONTAINER (alignment)->border_width;
       width = MAX (allocation->width - 2 * x, 0);
       height = MAX (allocation->height - 2 * y, 0);
       
-      if (width > bin->child->requisition.width)
-       child_allocation.width = (bin->child->requisition.width *
+      if (width > child_requisition.width)
+       child_allocation.width = (child_requisition.width *
                                  (1.0 - alignment->xscale) +
                                  width * alignment->xscale);
       else
        child_allocation.width = width;
       
-      if (height > bin->child->requisition.height)
-       child_allocation.height = (bin->child->requisition.height *
+      if (height > child_requisition.height)
+       child_allocation.height = (child_requisition.height *
                                   (1.0 - alignment->yscale) +
                                   height * alignment->yscale);
       else
index 5ee502266b1e8dec745ad261af34be5e4901691d..9faaeb3a702346cf37061d85cd8ff3f0d5bee894 100644 (file)
@@ -295,13 +295,16 @@ gtk_aspect_frame_size_allocate (GtkWidget     *widget,
     {
       if (aspect_frame->obey_child)
        {
-         if (bin->child->requisition.height != 0)
+         GtkRequisition child_requisition;
+
+         gtk_widget_get_child_requisition (bin->child, &child_requisition);
+         if (child_requisition.height != 0)
            {
-             ratio = (gdouble)bin->child->requisition.width /
-               bin->child->requisition.height;
+             ratio = (gdouble)child_requisition.width /
+                              child_requisition.height;
              if (ratio < MIN_RATIO) ratio = MIN_RATIO;
            }
-         else if (bin->child->requisition.width != 0)
+         else if (child_requisition.width != 0)
            ratio = MAX_RATIO;
          else
            ratio = 1.0;
index 8e3593bff95d51dbb83f0b67978a11282f0666e5..30346368ce89de863bb09e514bc0993033cbed22 100644 (file)
@@ -435,10 +435,12 @@ gtk_button_size_request (GtkWidget      *widget,
 
   if (GTK_BIN (button)->child && GTK_WIDGET_VISIBLE (GTK_BIN (button)->child))
     {
-      gtk_widget_size_request (GTK_BIN (button)->child, &GTK_BIN (button)->child->requisition);
+      GtkRequisition child_requisition;
 
-      requisition->width += GTK_BIN (button)->child->requisition.width;
-      requisition->height += GTK_BIN (button)->child->requisition.height;
+      gtk_widget_size_request (GTK_BIN (button)->child, &child_requisition);
+
+      requisition->width += child_requisition.width;
+      requisition->height += child_requisition.height;
     }
 }
 
index ecaaf5108826d7a9a7520a89e0c767dd5fac6cb6..f13449d33c9efd2360d587724f59ef2a5f6c761e 100644 (file)
@@ -5393,11 +5393,13 @@ gtk_clist_size_request (GtkWidget      *widget,
     for (i = 0; i < clist->columns; i++)
       if (clist->column[i].button)
        {
+         GtkRequisition child_requisition;
+         
          gtk_widget_size_request (clist->column[i].button,
-                                  &clist->column[i].button->requisition);
+                                  &child_requisition);
          clist->column_title_area.height =
            MAX (clist->column_title_area.height,
-                clist->column[i].button->requisition.height);
+                child_requisition.height);
        }
 
   requisition->width += (widget->style->klass->xthickness +
@@ -6088,14 +6090,15 @@ adjust_adjustments (GtkCList *clist,
   if (!block_resize && (!clist->vadjustment || !clist->hadjustment))
     {
       GtkWidget *widget;
+      GtkRequisition requisition;
 
       widget = GTK_WIDGET (clist);
-      gtk_widget_size_request (widget, &widget->requisition);
+      gtk_widget_size_request (widget, &requisition);
 
       if ((!clist->hadjustment &&
-          widget->requisition.width != widget->allocation.width) ||
+          requisition.width != widget->allocation.width) ||
          (!clist->vadjustment &&
-          widget->requisition.height != widget->allocation.height))
+          requisition.height != widget->allocation.height))
        gtk_widget_queue_resize (widget);
     }
 }
index e9b405bd1f138b1a63c5359d0ae50c602bd34e63..564068cc8ed48ebce6084b8ac46f04c41e55ecb5 100644 (file)
@@ -897,16 +897,17 @@ static void
 gtk_container_real_check_resize (GtkContainer *container)
 {
   GtkWidget *widget;
+  GtkRequisition requisition;
   
   g_return_if_fail (container != NULL);
   g_return_if_fail (GTK_IS_CONTAINER (container));
   
   widget = GTK_WIDGET (container);
   
-  gtk_widget_size_request (widget, &widget->requisition);
+  gtk_widget_size_request (widget, &requisition);
   
-  if (widget->requisition.width > widget->allocation.width ||
-      widget->requisition.height > widget->allocation.height)
+  if (requisition.width > widget->allocation.width ||
+      requisition.height > widget->allocation.height)
     {
       if (GTK_IS_RESIZE_CONTAINER (container))
        gtk_widget_size_allocate (GTK_WIDGET (container),
index 642ea264e88caf47252af6eb0a875472113cf569..9aca1315667522b9df7504829f4f1cbc4b69740f 100644 (file)
@@ -539,6 +539,7 @@ gtk_entry_realize (GtkWidget *widget)
 {
   GtkEntry *entry;
   GtkEditable *editable;
+  GtkRequisition requisition;
   GdkWindowAttr attributes;
   gint attributes_mask;
 
@@ -548,13 +549,15 @@ gtk_entry_realize (GtkWidget *widget)
   GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
   entry = GTK_ENTRY (widget);
   editable = GTK_EDITABLE (widget);
+
+  gtk_widget_get_child_requisition (widget, &requisition);
   
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.x = widget->allocation.x;
   attributes.y = widget->allocation.y + (widget->allocation.height -
-                                        widget->requisition.height) / 2;
+                                        requisition.height) / 2;
   attributes.width = widget->allocation.width;
-  attributes.height = widget->requisition.height;
+  attributes.height = requisition.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
   attributes.visual = gtk_widget_get_visual (widget);
   attributes.colormap = gtk_widget_get_colormap (widget);
@@ -576,7 +579,7 @@ gtk_entry_realize (GtkWidget *widget)
   attributes.x = widget->style->klass->xthickness;
   attributes.y = widget->style->klass->ythickness;
   attributes.width = widget->allocation.width - attributes.x * 2;
-  attributes.height = widget->requisition.height - attributes.y * 2;
+  attributes.height = requisition.height - attributes.y * 2;
   attributes.cursor = entry->cursor = gdk_cursor_new (GDK_XTERM);
   attributes_mask |= GDK_WA_CURSOR;
 
@@ -774,15 +777,22 @@ gtk_entry_size_allocate (GtkWidget     *widget,
 
   if (GTK_WIDGET_REALIZED (widget))
     {
+      /* We call gtk_widget_get_child_requisition, since we want (for
+       * backwards compatibility reasons) the realization here to
+       * be affected by the usize of the entry, if set
+       */
+      GtkRequisition requisition;
+      gtk_widget_get_child_requisition (widget, &requisition);
+  
       gdk_window_move_resize (widget->window,
                              allocation->x,
-                             allocation->y + (allocation->height - widget->requisition.height) / 2,
-                             allocation->width, widget->requisition.height);
+                             allocation->y + (allocation->height - requisition.height) / 2,
+                             allocation->width, requisition.height);
       gdk_window_move_resize (entry->text_area,
                              widget->style->klass->xthickness,
                              widget->style->klass->ythickness,
                              allocation->width - widget->style->klass->xthickness * 2,
-                             widget->requisition.height - widget->style->klass->ythickness * 2);
+                             requisition.height - widget->style->klass->ythickness * 2);
 
       /* And make sure the cursor is on screen */
       entry_adjust_scroll (entry);
index 3880a050a9fbb3a4617b72f2bc05edc441ec0339..ddf0f1d15f666d463387b9cea993ac0e352f2f54 100644 (file)
@@ -142,10 +142,12 @@ gtk_event_box_size_request (GtkWidget      *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
+      GtkRequisition child_requisition;
+      
+      gtk_widget_size_request (bin->child, &child_requisition);
 
-      requisition->width += bin->child->requisition.width;
-      requisition->height += bin->child->requisition.height;
+      requisition->width += child_requisition.width;
+      requisition->height += child_requisition.height;
     }
 }
 
index ef75f7728f13eacc721b8b6eae61bf4f5185a1e9..5b8c72f41422254c6b72521a3e35825f478f7c28 100644 (file)
@@ -250,6 +250,7 @@ gtk_fixed_size_request (GtkWidget      *widget,
   GtkFixed *fixed;  
   GtkFixedChild *child;
   GList *children;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_FIXED (widget));
@@ -267,14 +268,14 @@ gtk_fixed_size_request (GtkWidget      *widget,
 
       if (GTK_WIDGET_VISIBLE (child->widget))
        {
-          gtk_widget_size_request (child->widget, &child->widget->requisition);
+          gtk_widget_size_request (child->widget, &child_requisition);
 
           requisition->height = MAX (requisition->height,
                                      child->y +
-                                     child->widget->requisition.height);
+                                     child_requisition.height);
           requisition->width = MAX (requisition->width,
                                     child->x +
-                                    child->widget->requisition.width);
+                                    child_requisition.width);
        }
     }
 
@@ -289,6 +290,7 @@ gtk_fixed_size_allocate (GtkWidget     *widget,
   GtkFixed *fixed;
   GtkFixedChild *child;
   GtkAllocation child_allocation;
+  GtkRequisition child_requisition;
   GList *children;
   guint16 border_width;
 
@@ -316,10 +318,11 @@ gtk_fixed_size_allocate (GtkWidget     *widget,
       
       if (GTK_WIDGET_VISIBLE (child->widget))
        {
+         gtk_widget_get_child_requisition (child->widget, &child_requisition);
          child_allocation.x = child->x + border_width;
          child_allocation.y = child->y + border_width;
-         child_allocation.width = child->widget->requisition.width;
-         child_allocation.height = child->widget->requisition.height;
+         child_allocation.width = child_requisition.width;
+         child_allocation.height = child_requisition.height;
          gtk_widget_size_allocate (child->widget, &child_allocation);
        }
     }
index 789d158deb559b3b2c0f9b3a5d42a8f35fd6ba0f..afb19fcf1525c8dbc5b1d41759624fad3460e58d 100644 (file)
@@ -456,10 +456,12 @@ gtk_frame_size_request (GtkWidget      *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
+      GtkRequisition child_requisition;
+      
+      gtk_widget_size_request (bin->child, &child_requisition);
 
-      requisition->width += MAX (bin->child->requisition.width, frame->label_width);
-      requisition->height += bin->child->requisition.height;
+      requisition->width += MAX (child_requisition.width, frame->label_width);
+      requisition->height += child_requisition.height;
     }
   else
     {
index ff72ce08d7e49cef6235c9991b8cbb6c8d57574f..4df645ab016db3cf2604cddee4b4420d46f638b7 100644 (file)
@@ -415,6 +415,7 @@ gtk_handle_box_size_request (GtkWidget      *widget,
 {
   GtkBin *bin;
   GtkHandleBox *hb;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_HANDLE_BOX (widget));
@@ -439,7 +440,7 @@ gtk_handle_box_size_request (GtkWidget      *widget,
    * won't have any usefull hint for our size otherwise.
    */
   if (bin->child)
-    gtk_widget_size_request (bin->child, &bin->child->requisition);
+    gtk_widget_size_request (bin->child, &child_requisition);
 
   if (hb->child_detached)
     {
@@ -447,9 +448,9 @@ gtk_handle_box_size_request (GtkWidget      *widget,
        {
          if (hb->handle_position == GTK_POS_LEFT ||
              hb->handle_position == GTK_POS_RIGHT)
-           requisition->height += bin->child->requisition.height;
+           requisition->height += child_requisition.height;
          else
-           requisition->width += bin->child->requisition.width;
+           requisition->width += child_requisition.width;
        }
       else
        {
@@ -467,8 +468,8 @@ gtk_handle_box_size_request (GtkWidget      *widget,
       
       if (bin->child)
        {
-         requisition->width += bin->child->requisition.width;
-         requisition->height += bin->child->requisition.height;
+         requisition->width += child_requisition.width;
+         requisition->height += child_requisition.height;
        }
       else
        {
@@ -484,6 +485,7 @@ gtk_handle_box_size_allocate (GtkWidget     *widget,
 {
   GtkBin *bin;
   GtkHandleBox *hb;
+  GtkRequisition child_requisition;
   
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_HANDLE_BOX (widget));
@@ -494,16 +496,24 @@ gtk_handle_box_size_allocate (GtkWidget     *widget,
   
   widget->allocation.x = allocation->x;
 
+  if (bin->child)
+    gtk_widget_get_child_requisition (bin->child, &child_requisition);
+  else
+    {
+      child_requisition.width = 0;
+      child_requisition.height = 0;
+    }
+  
   if (hb->child_detached)
     {
       guint max_req_height;
       guint max_req_width;
 
       max_req_height = MAX (widget->requisition.height,
-                           bin->child->requisition.height +
+                           child_requisition.height +
                            2 * widget->style->klass->ythickness);
       max_req_width = MAX (widget->requisition.width,
-                          bin->child->requisition.width +
+                          child_requisition.width +
                           2 * widget->style->klass->xthickness);
       
       if (allocation->height > max_req_height)
@@ -549,8 +559,8 @@ gtk_handle_box_size_allocate (GtkWidget     *widget,
          guint float_width;
          guint float_height;
          
-         child_allocation.width = child->requisition.width;
-         child_allocation.height = child->requisition.height;
+         child_allocation.width = child_requisition.width;
+         child_allocation.height = child_requisition.height;
          
          float_width = child_allocation.width + 2 * border_width;
          float_height = child_allocation.height + 2 * border_width;
index 26bc649d7221e5dfc4092b56bc5c7193cb79267a..215a7efcbd73760e1be7ca67410b9b638b22f401 100644 (file)
@@ -57,7 +57,14 @@ struct _GtkHandleBox
   guint                  in_drag : 1;
   guint                  shrink_on_detach : 1;
 
-  gint dragoff_x, dragoff_y; /* start drag position (wrt widget->window) */
+  /* Variables used during a drag
+   */
+  gint dragoff_x, dragoff_y; /* offset from event->root_x/y and
+                             * attach point on float */
+  gint deskoff_x, deskoff_y; /* Offset between root relative coordinates
+                             * and deskrelative coordinates */
+  gint attach_x, attach_y;   /* Root relative-coordinates of attach
+                             * point on widget->window */
 };
 
 struct _GtkHandleBoxClass
index f705d9f563b01c5c33b7b928716a66dffa09fa22..5f3de5cd442a7e57f433e0692565e435dd36c644 100644 (file)
@@ -110,19 +110,21 @@ gtk_hbox_size_request (GtkWidget      *widget,
 
       if (GTK_WIDGET_VISIBLE (child->widget))
        {
-         gtk_widget_size_request (child->widget, &child->widget->requisition);
+         GtkRequisition child_requisition;
+
+         gtk_widget_size_request (child->widget, &child_requisition);
 
          if (box->homogeneous)
            {
-             width = child->widget->requisition.width + child->padding * 2;
+             width = child_requisition.width + child->padding * 2;
              requisition->width = MAX (requisition->width, width);
            }
          else
            {
-             requisition->width += child->widget->requisition.width + child->padding * 2;
+             requisition->width += child_requisition.width + child->padding * 2;
            }
 
-         requisition->height = MAX (requisition->height, child->widget->requisition.height);
+         requisition->height = MAX (requisition->height, child_requisition.height);
 
          nvis_children += 1;
        }
@@ -189,7 +191,7 @@ gtk_hbox_size_allocate (GtkWidget     *widget,
        }
       else if (nexpand_children > 0)
        {
-         width = (gint)allocation->width - (gint)widget->requisition.width;
+         width = (gint) allocation->width - (gint) widget->requisition.width;
          extra = width / nexpand_children;
        }
       else
@@ -200,7 +202,7 @@ gtk_hbox_size_allocate (GtkWidget     *widget,
 
       x = allocation->x + GTK_CONTAINER (box)->border_width;
       child_allocation.y = allocation->y + GTK_CONTAINER (box)->border_width;
-      child_allocation.height = MAX (1, (gint)allocation->height - (gint)GTK_CONTAINER (box)->border_width * 2);
+      child_allocation.height = MAX (1, (gint) allocation->height - (gint) GTK_CONTAINER (box)->border_width * 2);
 
       children = box->children;
       while (children)
@@ -222,7 +224,11 @@ gtk_hbox_size_allocate (GtkWidget     *widget,
                }
              else
                {
-                 child_width = child->widget->requisition.width + child->padding * 2;
+                 GtkRequisition child_requisition;
+
+                 gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
+                 child_width = child_requisition.width + child->padding * 2;
 
                  if (child->expand)
                    {
@@ -238,12 +244,15 @@ gtk_hbox_size_allocate (GtkWidget     *widget,
 
              if (child->fill)
                {
-                 child_allocation.width = MAX (1, (gint)child_width - (gint)child->padding * 2);
+                 child_allocation.width = MAX (1, (gint) child_width - (gint) child->padding * 2);
                  child_allocation.x = x + child->padding;
                }
              else
                {
-                 child_allocation.width = child->widget->requisition.width;
+                 GtkRequisition child_requisition;
+
+                 gtk_widget_get_child_requisition (child->widget, &child_requisition);
+                 child_allocation.width = child_requisition.width;
                  child_allocation.x = x + (child_width - child_allocation.width) / 2;
                }
 
@@ -263,6 +272,9 @@ gtk_hbox_size_allocate (GtkWidget     *widget,
 
          if ((child->pack == GTK_PACK_END) && GTK_WIDGET_VISIBLE (child->widget))
            {
+             GtkRequisition child_requisition;
+             gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
               if (box->homogeneous)
                 {
                   if (nvis_children == 1)
@@ -275,7 +287,7 @@ gtk_hbox_size_allocate (GtkWidget     *widget,
                 }
               else
                 {
-                 child_width = child->widget->requisition.width + child->padding * 2;
+                 child_width = child_requisition.width + child->padding * 2;
 
                   if (child->expand)
                     {
@@ -296,7 +308,7 @@ gtk_hbox_size_allocate (GtkWidget     *widget,
                 }
               else
                 {
-                  child_allocation.width = child->widget->requisition.width;
+                 child_allocation.width = child_requisition.width;
                   child_allocation.x = x + (child_width - child_allocation.width) / 2 - child_width;
                 }
 
index 1eac179b8530322e8290485eae99ca52686b4877..e71935a4e1bec696ed947cc0e33ba82bef56361d 100644 (file)
@@ -96,6 +96,7 @@ gtk_hpaned_size_request (GtkWidget      *widget,
                         GtkRequisition *requisition)
 {
   GtkPaned *paned;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_HPANED (widget));
@@ -107,19 +108,18 @@ gtk_hpaned_size_request (GtkWidget      *widget,
 
   if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
     {
-      gtk_widget_size_request (paned->child1, &paned->child1->requisition);
+      gtk_widget_size_request (paned->child1, &child_requisition);
 
-      requisition->height = paned->child1->requisition.height;
-      requisition->width = paned->child1->requisition.width;
+      requisition->height = child_requisition.height;
+      requisition->width = child_requisition.width;
     }
 
   if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
     {
-      gtk_widget_size_request (paned->child2, &paned->child2->requisition);
+      gtk_widget_size_request (paned->child2, &child_requisition);
 
-      requisition->height = MAX(requisition->height,
-                               paned->child2->requisition.height);
-      requisition->width += paned->child2->requisition.width;
+      requisition->height = MAX(requisition->height, child_requisition.height);
+      requisition->width += child_requisition.width;
     }
 
   requisition->width += GTK_CONTAINER (paned)->border_width * 2 + paned->gutter_size;
@@ -131,6 +131,8 @@ gtk_hpaned_size_allocate (GtkWidget     *widget,
                          GtkAllocation *allocation)
 {
   GtkPaned *paned;
+  GtkRequisition child1_requisition;
+  GtkRequisition child2_requisition;
   GtkAllocation child1_allocation;
   GtkAllocation child2_allocation;
   GdkRectangle old_groove_rectangle;
@@ -145,12 +147,22 @@ gtk_hpaned_size_allocate (GtkWidget     *widget,
   paned = GTK_PANED (widget);
   border_width = GTK_CONTAINER (paned)->border_width;
 
+  if (paned->child1)
+    gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
+  else
+    child1_requisition.width = 0;
+
+  if (paned->child2)
+    gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
+  else
+    child2_requisition.width = 0;
+    
   gtk_paned_compute_position (paned,
                              widget->allocation.width
                                - paned->gutter_size
                                - 2 * border_width,
-                             paned->child1 ? paned->child1->requisition.width : 0,
-                             paned->child2 ? paned->child2->requisition.width : 0);
+                             child1_requisition.width,
+                             child2_requisition.width);
   
   /* Move the handle before the children so we don't get extra expose events */
 
index 353c3f1a8c08e7525e42287714fc16017631a0a7..532755c0c5560d40d30c3d5a446284b691fc6757 100644 (file)
@@ -244,8 +244,6 @@ gtk_layout_put (GtkLayout     *layout,
   child->widget = child_widget;
   child->x = x;
   child->y = y;
-  child->widget->requisition.width = 0;
-  child->widget->requisition.height = 0;
 
   layout->children = g_list_append (layout->children, child);
   
@@ -559,9 +557,11 @@ gtk_layout_size_request (GtkWidget     *widget,
   while (tmp_list)
     {
       GtkLayoutChild *child = tmp_list->data;
+      GtkRequisition child_requisition;
+      
       tmp_list = tmp_list->next;
 
-      gtk_widget_size_request (child->widget, &child->widget->requisition);
+      gtk_widget_size_request (child->widget, &child_requisition);
     }
 }
 
@@ -776,11 +776,13 @@ gtk_layout_allocate_child (GtkLayout      *layout,
                           GtkLayoutChild *child)
 {
   GtkAllocation allocation;
+  GtkRequisition requisition;
 
   allocation.x = child->x - layout->xoffset;
   allocation.y = child->y - layout->yoffset;
-  allocation.width = child->widget->requisition.width;
-  allocation.height = child->widget->requisition.height;
+  gtk_widget_get_child_requisition (child->widget, &requisition);
+  allocation.width = requisition.width;
+  allocation.height = requisition.height;
   
   gtk_widget_size_allocate (child->widget, &allocation);
 }
index c18431d4be41b9bce0b240433af1519bb7a59a56..9948c0582ec2a3447dbb086c9d9b6d0aa56a0a80 100644 (file)
@@ -326,11 +326,13 @@ gtk_list_size_request (GtkWidget      *widget,
 
       if (GTK_WIDGET_VISIBLE (child))
        {
-         gtk_widget_size_request (child, &child->requisition);
+         GtkRequisition child_requisition;
+         
+         gtk_widget_size_request (child, &child_requisition);
 
          requisition->width = MAX (requisition->width,
-                                   child->requisition.width);
-         requisition->height += child->requisition.height;
+                                   child_requisition.width);
+         requisition->height += child_requisition.height;
        }
     }
 
@@ -378,7 +380,10 @@ gtk_list_size_allocate (GtkWidget     *widget,
 
          if (GTK_WIDGET_VISIBLE (child))
            {
-             child_allocation.height = child->requisition.height;
+             GtkRequisition child_requisition;
+             gtk_widget_get_child_requisition (child, &child_requisition);
+             
+             child_allocation.height = child_requisition.height;
 
              gtk_widget_size_allocate (child, &child_allocation);
 
index de9453687828d920b03438bb5e8c1a11a252d0a7..7fd7dfcfa70afd7bc7d49bb29b7545fdbf866a2c 100644 (file)
@@ -392,6 +392,7 @@ gtk_list_item_size_request (GtkWidget      *widget,
                            GtkRequisition *requisition)
 {
   GtkBin *bin;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_LIST_ITEM (widget));
@@ -405,10 +406,10 @@ gtk_list_item_size_request (GtkWidget      *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
+      gtk_widget_size_request (bin->child, &child_requisition);
 
-      requisition->width += bin->child->requisition.width;
-      requisition->height += bin->child->requisition.height;
+      requisition->width += child_requisition.width;
+      requisition->height += child_requisition.height;
     }
 }
 
index 14c01f3cc5acbdced3882feff7e47397793daaf8..e4e1a709ff082e20eb9cf8ed35e8429873096037 100644 (file)
@@ -702,6 +702,7 @@ gtk_menu_size_request (GtkWidget      *widget,
   GList *children;
   guint max_toggle_size;
   guint max_accel_width;
+  GtkRequisition child_requisition;
   
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_MENU (widget));
@@ -725,10 +726,10 @@ gtk_menu_size_request (GtkWidget      *widget,
       if (GTK_WIDGET_VISIBLE (child))
        {
          GTK_MENU_ITEM (child)->show_submenu_indicator = TRUE;
-         gtk_widget_size_request (child, &child->requisition);
+         gtk_widget_size_request (child, &child_requisition);
          
-         requisition->width = MAX (requisition->width, child->requisition.width);
-         requisition->height += child->requisition.height;
+         requisition->width = MAX (requisition->width, child_requisition.width);
+         requisition->height += child_requisition.height;
          
          max_toggle_size = MAX (max_toggle_size, MENU_ITEM_CLASS (child)->toggle_size);
          max_accel_width = MAX (max_accel_width, GTK_MENU_ITEM (child)->accelerator_width);
@@ -791,7 +792,10 @@ gtk_menu_size_allocate (GtkWidget     *widget,
          
          if (GTK_WIDGET_VISIBLE (child))
            {
-             child_allocation.height = child->requisition.height;
+             GtkRequisition child_requisition;
+             gtk_widget_get_child_requisition (child, &child_requisition);
+             
+             child_allocation.height = child_requisition.height;
              
              gtk_widget_size_allocate (child, &child_allocation);
              gtk_widget_queue_draw (child);
@@ -1013,6 +1017,7 @@ static void
 gtk_menu_position (GtkMenu *menu)
 {
   GtkWidget *widget;
+  GtkRequisition requisition;
   gint x, y;
  
   g_return_if_fail (menu != NULL);
@@ -1027,7 +1032,7 @@ gtk_menu_position (GtkMenu *menu)
    * if one a size_request was queued while we weren't popped up,
    * the requisition won't have been recomputed yet.
    */
-  gtk_widget_size_request (widget, &widget->requisition);
+  gtk_widget_size_request (widget, &requisition);
       
   if (menu->position_func)
     (* menu->position_func) (menu, &x, &y, menu->position_func_data);
@@ -1042,12 +1047,12 @@ gtk_menu_position (GtkMenu *menu)
       x -= 2;
       y -= 2;
       
-      if ((x + widget->requisition.width) > screen_width)
-       x -= ((x + widget->requisition.width) - screen_width);
+      if ((x + requisition.width) > screen_width)
+       x -= ((x + requisition.width) - screen_width);
       if (x < 0)
        x = 0;
-      if ((y + widget->requisition.height) > screen_height)
-       y -= ((y + widget->requisition.height) - screen_height);
+      if ((y + requisition.height) > screen_height)
+       y -= ((y + requisition.height) - screen_height);
       if (y < 0)
        y = 0;
     }
index d01fe2c2c5d429064591f1c5cdb16a48c37bdc0d..81610850ee96e74815e3cd05a64d93247b2b515b 100644 (file)
@@ -208,6 +208,7 @@ gtk_menu_bar_size_request (GtkWidget      *widget,
   GtkWidget *child;
   GList *children;
   gint nchildren;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_MENU_BAR (widget));
@@ -232,13 +233,13 @@ gtk_menu_bar_size_request (GtkWidget      *widget,
          if (GTK_WIDGET_VISIBLE (child))
            {
              GTK_MENU_ITEM (child)->show_submenu_indicator = FALSE;
-             gtk_widget_size_request (child, &child->requisition);
+             gtk_widget_size_request (child, &child_requisition);
 
-             requisition->width += child->requisition.width;
-             requisition->height = MAX (requisition->height, child->requisition.height);
+             requisition->width += child_requisition.width;
+             requisition->height = MAX (requisition->height, child_requisition.height);
              /* Support for the right justified help menu */
-             if ( (children == NULL) && (GTK_IS_MENU_ITEM(child))
-                  && (GTK_MENU_ITEM(child)->right_justify))
+             if ((children == NULL) && GTK_IS_MENU_ITEM(child) &&
+                 GTK_MENU_ITEM(child)->right_justify)
                {
                  requisition->width += CHILD_SPACING;
                }
@@ -268,6 +269,7 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
   GtkWidget *child;
   GList *children;
   GtkAllocation child_allocation;
+  GtkRequisition child_requisition;
   guint offset;
   
   g_return_if_fail (widget != NULL);
@@ -301,16 +303,18 @@ gtk_menu_bar_size_allocate (GtkWidget     *widget,
          child = children->data;
          children = children->next;
 
+         gtk_widget_get_child_requisition (child, &child_requisition);
+         
          /* Support for the right justified help menu */
          if ( (children == NULL) && (GTK_IS_MENU_ITEM(child))
              && (GTK_MENU_ITEM(child)->right_justify)) 
            {
              child_allocation.x = allocation->width -
-                 child->requisition.width - CHILD_SPACING - offset;
+                 child_requisition.width - CHILD_SPACING - offset;
            }
          if (GTK_WIDGET_VISIBLE (child))
            {
-             child_allocation.width = child->requisition.width;
+             child_allocation.width = child_requisition.width;
 
              gtk_widget_size_allocate (child, &child_allocation);
 
index 3241a1a7683b19bd425bdd77f1d335e65fdd8f02..ac3d47eeb9b706bb52fc27726b0ea426643f7148 100644 (file)
@@ -346,10 +346,12 @@ gtk_menu_item_size_request (GtkWidget      *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
+      GtkRequisition child_requisition;
+      
+      gtk_widget_size_request (bin->child, &child_requisition);
 
-      requisition->width += bin->child->requisition.width;
-      requisition->height += bin->child->requisition.height;
+      requisition->width += child_requisition.width;
+      requisition->height += child_requisition.height;
     }
 
   if (menu_item->submenu && menu_item->show_submenu_indicator)
index 88dd82905424e673119c53cb2d353e92c8c6a569..b8d3cb75c9956630e976517e498698696a671b5a 100644 (file)
@@ -563,6 +563,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
   GtkNotebook *notebook;
   GtkNotebookPage *page;
   GList *children;
+  GtkRequisition child_requisition;
   gboolean switch_page = FALSE;
   gint vis_pages;
 
@@ -582,12 +583,12 @@ gtk_notebook_size_request (GtkWidget      *widget,
       if (GTK_WIDGET_VISIBLE (page->child))
        {
          vis_pages++;
-         gtk_widget_size_request (page->child, &page->child->requisition);
+         gtk_widget_size_request (page->child, &child_requisition);
          
          widget->requisition.width = MAX (widget->requisition.width,
-                                          page->child->requisition.width);
+                                          child_requisition.width);
          widget->requisition.height = MAX (widget->requisition.height,
-                                           page->child->requisition.height);
+                                           child_requisition.height);
 
          if (GTK_WIDGET_MAPPED (page->child) && page != notebook->cur_page)
            gtk_widget_unmap (page->child);
@@ -627,14 +628,14 @@ gtk_notebook_size_request (GtkWidget      *widget,
                  if (!GTK_WIDGET_VISIBLE (page->tab_label))
                    gtk_widget_show (page->tab_label);
 
-                 gtk_widget_size_request (page->tab_label, 
-                                          &page->tab_label->requisition);
+                 gtk_widget_size_request (page->tab_label,
+                                          &child_requisition);
 
                  page->requisition.width = 
-                   page->tab_label->requisition.width +
+                   child_requisition.width +
                    2 * widget->style->klass->xthickness;
                  page->requisition.height = 
-                   page->tab_label->requisition.height +
+                   child_requisition.height +
                    2 * widget->style->klass->ythickness;
                  
                  switch (notebook->tab_pos)
@@ -2990,6 +2991,7 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
 {
   GtkWidget *widget;
   GtkAllocation child_allocation;
+  GtkRequisition tab_requisition;
   gint xthickness;
   gint ythickness;
   gint padding;
@@ -3051,6 +3053,7 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
     }
 
   page->allocation = *allocation;
+  gtk_widget_get_child_requisition (page->tab_label, &tab_requisition);
 
   if (notebook->cur_page != page)
     {
@@ -3086,8 +3089,8 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
        {
          child_allocation.x = (page->allocation.x +
                                (page->allocation.width -
-                                page->tab_label->requisition.width) / 2);
-         child_allocation.width = page->tab_label->requisition.width;
+                                tab_requisition.width) / 2);
+         child_allocation.width = tab_requisition.width;
        }
       child_allocation.y = (notebook->tab_vborder + FOCUS_WIDTH +
                            page->allocation.y);
@@ -3110,8 +3113,8 @@ gtk_notebook_page_allocate (GtkNotebook     *notebook,
        {
          child_allocation.y = (page->allocation.y +
                                (page->allocation.height -
-                                page->tab_label->requisition.height) / 2);
-         child_allocation.height = page->tab_label->requisition.height;
+                                tab_requisition.height) / 2);
+         child_allocation.height = tab_requisition.height;
        }
       child_allocation.x = (page->allocation.x + notebook->tab_hborder +
                            FOCUS_WIDTH);
index c888625fca9252286ff5ed52e1c7af10d50ff019..78dae5cf59b98e667b649abcd3b029017698b5d9 100644 (file)
@@ -517,6 +517,7 @@ static void
 gtk_option_menu_update_contents (GtkOptionMenu *option_menu)
 {
   GtkWidget *child;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (option_menu != NULL);
   g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
@@ -540,7 +541,7 @@ gtk_option_menu_update_contents (GtkOptionMenu *option_menu)
              gtk_widget_reparent (child, GTK_WIDGET (option_menu));
            }
 
-         gtk_widget_size_request (child, &child->requisition);
+         gtk_widget_size_request (child, &child_requisition);
          gtk_widget_size_allocate (GTK_WIDGET (option_menu),
                                    &(GTK_WIDGET (option_menu)->allocation));
 
@@ -572,6 +573,7 @@ gtk_option_menu_calc_size (GtkOptionMenu *option_menu)
 {
   GtkWidget *child;
   GList *children;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (option_menu != NULL);
   g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
@@ -589,10 +591,10 @@ gtk_option_menu_calc_size (GtkOptionMenu *option_menu)
 
          if (GTK_WIDGET_VISIBLE (child))
            {
-             gtk_widget_size_request (child, &child->requisition);
+             gtk_widget_size_request (child, &child_requisition);
 
-             option_menu->width = MAX (option_menu->width, child->requisition.width);
-             option_menu->height = MAX (option_menu->height, child->requisition.height);
+             option_menu->width = MAX (option_menu->width, child_requisition.width);
+             option_menu->height = MAX (option_menu->height, child_requisition.height);
            }
        }
     }
index 2909f7c288bc6267a9ab0d8b3ebcb8fb9b7e1efc..7713a9e9e67db26e9bbcbb0e867c5e28167da0bc 100644 (file)
@@ -897,7 +897,8 @@ gtk_packer_unmap (GtkWidget *widget)
 }
 
 static void 
-gtk_packer_draw (GtkWidget *widget, GdkRectangle     *area)
+gtk_packer_draw (GtkWidget    *widget,
+                GdkRectangle *area)
 {
   GtkPacker *packer;
   GtkPackerChild *child;
@@ -925,7 +926,8 @@ gtk_packer_draw (GtkWidget *widget, GdkRectangle     *area)
 }
 
 static gint 
-gtk_packer_expose (GtkWidget *widget, GdkEventExpose *event)
+gtk_packer_expose (GtkWidget      *widget,
+                  GdkEventExpose *event)
 {
   GtkPacker *packer;
   GtkPackerChild *child;
@@ -958,7 +960,8 @@ gtk_packer_expose (GtkWidget *widget, GdkEventExpose *event)
 }
 
 static void 
-gtk_packer_size_request (GtkWidget *widget, GtkRequisition *requisition)
+gtk_packer_size_request (GtkWidget      *widget,
+                        GtkRequisition *requisition)
 {
   GtkPacker *packer;
   GtkContainer *container;
@@ -968,6 +971,7 @@ gtk_packer_size_request (GtkWidget *widget, GtkRequisition *requisition)
   gint nvis_horz_children;
   gint width, height;
   gint maxWidth, maxHeight;
+  GtkRequisition child_requisition;
   
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_PACKER (widget));
@@ -990,27 +994,29 @@ gtk_packer_size_request (GtkWidget *widget, GtkRequisition *requisition)
       
       if (GTK_WIDGET_VISIBLE (child->widget)) 
        {
-         gtk_widget_size_request (child->widget, &child->widget->requisition);
+         GtkRequisition child_requisition;
+
+         gtk_widget_size_request (child->widget, &child_requisition);
          
-         if((child->side == GTK_SIDE_TOP) || (child->side == GTK_SIDE_BOTTOM))
+         if ((child->side == GTK_SIDE_TOP) || (child->side == GTK_SIDE_BOTTOM))
            {
              maxWidth = MAX (maxWidth,
-                             (child->widget->requisition.width +
+                             (child_requisition.width +
                               2 * child->border_width +
                               child->pad_x + child->i_pad_x +
                               width));
-             height += (child->widget->requisition.height +
+             height += (child_requisition.height +
                         2 * child->border_width +
                         child->pad_y + child->i_pad_y);
             } 
          else 
            {
              maxHeight = MAX (maxHeight,
-                              (child->widget->requisition.height +
+                              (child_requisition.height +
                                2 * child->border_width +
                                child->pad_y + child->i_pad_y +
                                height));
-             width += (child->widget->requisition.width +
+             width += (child_requisition.width +
                        2 * child->border_width +
                        child->pad_x + child->i_pad_x);
             }
@@ -1024,7 +1030,8 @@ gtk_packer_size_request (GtkWidget *widget, GtkRequisition *requisition)
 }
 
 static gint
-YExpansion (GList *children, gint cavityHeight)
+YExpansion (GList *children,
+           gint   cavityHeight)
 {
   GList *list;
   GtkPackerChild *child;
@@ -1038,9 +1045,13 @@ YExpansion (GList *children, gint cavityHeight)
   list = children;
   while (list != NULL) 
     {
+      GtkRequisition child_requisition;
+
       child = list->data;
       widget = child->widget;
-      childHeight = (widget->requisition.height +
+      gtk_widget_get_child_requisition (widget, &child_requisition);
+
+      childHeight = (child_requisition.height +
                     2 * child->border_width +
                     child->i_pad_y +
                     child->pad_y);
@@ -1064,7 +1075,8 @@ YExpansion (GList *children, gint cavityHeight)
 }
 
 static gint
-XExpansion (GList *children, gint cavityWidth)
+XExpansion (GList *children,
+           gint   cavityWidth)
 {
   GList *list;
   GtkPackerChild *child;
@@ -1078,9 +1090,13 @@ XExpansion (GList *children, gint cavityWidth)
   list = children;
   while (list != NULL) 
     {
+      GtkRequisition child_requisition;
+
       child = list->data;
       widget = child->widget;
-      childWidth = (widget->requisition.width +
+      gtk_widget_get_child_requisition (widget, &child_requisition);
+
+      childWidth = (child_requisition.width +
                    2 * child->border_width +
                    child->i_pad_x +
                    child->pad_x);
@@ -1105,7 +1121,8 @@ XExpansion (GList *children, gint cavityWidth)
 }
 
 static void 
-gtk_packer_size_allocate (GtkWidget *widget, GtkAllocation  *allocation)
+gtk_packer_size_allocate (GtkWidget      *widget,
+                         GtkAllocation  *allocation)
 {
   GtkPacker *packer;
   GtkContainer *container;
@@ -1137,12 +1154,15 @@ gtk_packer_size_allocate (GtkWidget *widget, GtkAllocation  *allocation)
   list = g_list_first (packer->children);
   while (list != NULL)
     {
+      GtkRequisition child_requisition;
+
       child = list->data;
+      gtk_widget_get_child_requisition (child->widget, &child_requisition);
       
       if ((child->side == GTK_SIDE_TOP) || (child->side == GTK_SIDE_BOTTOM)) 
        {
          frameWidth = cavityWidth;
-         frameHeight = (child->widget->requisition.height +
+         frameHeight = (child_requisition.height +
                         2 * child->border_width +
                         child->pad_y +
                         child->i_pad_y);
@@ -1168,7 +1188,7 @@ gtk_packer_size_allocate (GtkWidget *widget, GtkAllocation  *allocation)
       else 
        {
          frameHeight = cavityHeight;
-         frameWidth = (child->widget->requisition.width +
+         frameWidth = (child_requisition.width +
                        2 * child->border_width +
                        child->pad_x +
                        child->i_pad_x);
@@ -1194,13 +1214,13 @@ gtk_packer_size_allocate (GtkWidget *widget, GtkAllocation  *allocation)
       borderX = child->pad_x + 2 * child->border_width;
       borderY = child->pad_y + 2 * child->border_width;
       
-      width = (child->widget->requisition.width +
+      width = (child_requisition.width +
               2 * child->border_width +
               child->i_pad_x);
       if ((child->options & GTK_FILL_X) || (width > (frameWidth - borderX)))
        width = frameWidth - borderX;
 
-      height = (child->widget->requisition.height +
+      height = (child_requisition.height +
                2 * child->border_width +
                child->i_pad_y);
       if ((child->options & GTK_FILL_Y) || (height > (frameHeight - borderY)))
index b80a4a04ebc9bdda4f0f2bcc0340f604f73f7ec6..2651acc880789999de85359ee79277ff6c340d9e 100644 (file)
@@ -581,6 +581,9 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
   GtkBin *bin;
   gint extra_height;
   gint extra_width;
+  GtkRequisition hscrollbar_requisition;
+  GtkRequisition vscrollbar_requisition;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_SCROLLED_WINDOW (widget));
@@ -593,9 +596,9 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
   requisition->height = 0;
   
   gtk_widget_size_request (scrolled_window->hscrollbar,
-                          &scrolled_window->hscrollbar->requisition);
+                          &hscrollbar_requisition);
   gtk_widget_size_request (scrolled_window->vscrollbar,
-                          &scrolled_window->vscrollbar->requisition);
+                          &vscrollbar_requisition);
   
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
@@ -604,10 +607,10 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
       if (!quark_aux_info)
        quark_aux_info = g_quark_from_static_string ("gtk-aux-info");
 
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
+      gtk_widget_size_request (bin->child, &child_requisition);
 
       if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER)
-       requisition->width += bin->child->requisition.width;
+       requisition->width += child_requisition.width;
       else
        {
          GtkWidgetAuxInfo *aux_info;
@@ -616,11 +619,11 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
          if (aux_info && aux_info->width > 0)
            requisition->width += aux_info->width;
          else
-           requisition->width += scrolled_window->vscrollbar->requisition.width;
+           requisition->width += vscrollbar_requisition.width;
        }
 
       if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER)
-       requisition->height += bin->child->requisition.height;
+       requisition->height += child_requisition.height;
       else
        {
          GtkWidgetAuxInfo *aux_info;
@@ -629,7 +632,7 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
          if (aux_info && aux_info->height > 0)
            requisition->height += aux_info->height;
          else
-           requisition->height += scrolled_window->hscrollbar->requisition.height;
+           requisition->height += hscrollbar_requisition.height;
        }
     }
 
@@ -639,15 +642,15 @@ gtk_scrolled_window_size_request (GtkWidget      *widget,
   if ((scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC) ||
       GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
     {
-      requisition->width = MAX (requisition->width, scrolled_window->hscrollbar->requisition.width);
-      extra_height = SCROLLBAR_SPACING (scrolled_window) + scrolled_window->hscrollbar->requisition.height;
+      requisition->width = MAX (requisition->width, hscrollbar_requisition.width);
+      extra_height = SCROLLBAR_SPACING (scrolled_window) + hscrollbar_requisition.height;
     }
 
   if ((scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC) ||
       GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
     {
-      requisition->height = MAX (requisition->height, scrolled_window->vscrollbar->requisition.height);
-      extra_width = SCROLLBAR_SPACING (scrolled_window) + scrolled_window->vscrollbar->requisition.width;
+      requisition->height = MAX (requisition->height, vscrollbar_requisition.height);
+      extra_width = SCROLLBAR_SPACING (scrolled_window) + vscrollbar_requisition.width;
     }
 
   requisition->width += GTK_CONTAINER (widget)->border_width * 2 + extra_width;
@@ -672,24 +675,32 @@ gtk_scrolled_window_relative_allocation (GtkWidget     *widget,
 
   if (scrolled_window->vscrollbar_visible)
     {
+      GtkRequisition vscrollbar_requisition;
+      gtk_widget_get_child_requisition (scrolled_window->vscrollbar,
+                                       &vscrollbar_requisition);
+  
       if (scrolled_window->window_placement == GTK_CORNER_TOP_RIGHT ||
          scrolled_window->window_placement == GTK_CORNER_BOTTOM_RIGHT)
-       allocation->x += (scrolled_window->vscrollbar->requisition.width +
+       allocation->x += (vscrollbar_requisition.width +
                          SCROLLBAR_SPACING (scrolled_window));
 
       allocation->width = MAX (1, (gint)allocation->width -
-                              ((gint)scrolled_window->vscrollbar->requisition.width +
+                              ((gint)vscrollbar_requisition.width +
                                (gint)SCROLLBAR_SPACING (scrolled_window)));
     }
   if (scrolled_window->hscrollbar_visible)
     {
+      GtkRequisition hscrollbar_requisition;
+      gtk_widget_get_child_requisition (scrolled_window->hscrollbar,
+                                       &hscrollbar_requisition);
+  
       if (scrolled_window->window_placement == GTK_CORNER_BOTTOM_LEFT ||
          scrolled_window->window_placement == GTK_CORNER_BOTTOM_RIGHT)
-       allocation->y += (scrolled_window->hscrollbar->requisition.height +
+       allocation->y += (hscrollbar_requisition.height +
                          SCROLLBAR_SPACING (scrolled_window));
 
       allocation->height = MAX (1, (gint)allocation->height -
-                               ((gint)scrolled_window->hscrollbar->requisition.height +
+                               ((gint)hscrollbar_requisition.height +
                                 (gint)SCROLLBAR_SPACING (scrolled_window)));
     }
 }
@@ -767,6 +778,10 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
   
   if (scrolled_window->hscrollbar_visible)
     {
+      GtkRequisition hscrollbar_requisition;
+      gtk_widget_get_child_requisition (scrolled_window->hscrollbar,
+                                       &hscrollbar_requisition);
+  
       if (!GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
        gtk_widget_show (scrolled_window->hscrollbar);
 
@@ -780,7 +795,7 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
        child_allocation.y = GTK_CONTAINER (scrolled_window)->border_width;
 
       child_allocation.width = relative_allocation.width;
-      child_allocation.height = scrolled_window->hscrollbar->requisition.height;
+      child_allocation.height = hscrollbar_requisition.height;
       child_allocation.x += allocation->x;
       child_allocation.y += allocation->y;
 
@@ -791,9 +806,13 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
 
   if (scrolled_window->vscrollbar_visible)
     {
+      GtkRequisition vscrollbar_requisition;
       if (!GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
        gtk_widget_show (scrolled_window->vscrollbar);
 
+      gtk_widget_get_child_requisition (scrolled_window->vscrollbar,
+                                       &vscrollbar_requisition);
+
       if (scrolled_window->window_placement == GTK_CORNER_TOP_LEFT ||
          scrolled_window->window_placement == GTK_CORNER_BOTTOM_LEFT)
        child_allocation.x = (relative_allocation.x +
@@ -803,7 +822,7 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
        child_allocation.x = GTK_CONTAINER (scrolled_window)->border_width;
 
       child_allocation.y = relative_allocation.y;
-      child_allocation.width = scrolled_window->vscrollbar->requisition.width;
+      child_allocation.width = vscrollbar_requisition.width;
       child_allocation.height = relative_allocation.height;
       child_allocation.x += allocation->x;
       child_allocation.y += allocation->y;
index 1df52ffafa1195d56c9e092370655712bc100fee..c673f617e876c49c68cd9cf414e033cbe5e1684b 100644 (file)
@@ -47,6 +47,8 @@ static GdkFilterReturn gtk_socket_filter_func   (GdkXEvent *gdk_xevent,
                                                 GdkEvent *event, 
                                                 gpointer data);
 
+#define DEBUG_PLUGSOCKET
+
 #ifdef DEBUG_PLUGSOCKET
 #define DPRINTF(arg) g_print arg
 #else
index f3e5aca30db98d9dc7bd6384e699e1662eb1faca..ec4c927aeabb104de0401e6a0ad056eb3a1dd201 100644 (file)
@@ -919,7 +919,7 @@ gtk_table_size_request_init (GtkTable *table)
       children = children->next;
       
       if (GTK_WIDGET_VISIBLE (child->widget))
-       gtk_widget_size_request (child->widget, &child->widget->requisition);
+       gtk_widget_size_request (child->widget, NULL);
     }
 }
 
@@ -939,11 +939,14 @@ gtk_table_size_request_pass1 (GtkTable *table)
       
       if (GTK_WIDGET_VISIBLE (child->widget))
        {
+         GtkRequisition child_requisition;
+         gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
          /* Child spans a single column.
           */
          if (child->left_attach == (child->right_attach - 1))
            {
-             width = child->widget->requisition.width + child->xpadding * 2;
+             width = child_requisition.width + child->xpadding * 2;
              table->cols[child->left_attach].requisition = MAX (table->cols[child->left_attach].requisition, width);
            }
          
@@ -951,7 +954,7 @@ gtk_table_size_request_pass1 (GtkTable *table)
           */
          if (child->top_attach == (child->bottom_attach - 1))
            {
-             height = child->widget->requisition.height + child->ypadding * 2;
+             height = child_requisition.height + child->ypadding * 2;
              table->rows[child->top_attach].requisition = MAX (table->rows[child->top_attach].requisition, height);
            }
        }
@@ -1003,6 +1006,10 @@ gtk_table_size_request_pass3 (GtkTable *table)
           */
          if (child->left_attach != (child->right_attach - 1))
            {
+             GtkRequisition child_requisition;
+
+             gtk_widget_get_child_requisition (child->widget, &child_requisition);
+             
              /* Check and see if there is already enough space
               *  for the child.
               */
@@ -1018,9 +1025,9 @@ gtk_table_size_request_pass3 (GtkTable *table)
               *  its requisition, then divide up the needed space evenly
               *  amongst the columns it spans.
               */
-             if (width < child->widget->requisition.width + child->xpadding * 2)
+             if (width < child_requisition.width + child->xpadding * 2)
                {
-                 width = child->widget->requisition.width + child->xpadding * 2 - width;
+                 width = child_requisition.width + child->xpadding * 2 - width;
                  
                  for (col = child->left_attach; col < child->right_attach; col++)
                    {
@@ -1035,6 +1042,10 @@ gtk_table_size_request_pass3 (GtkTable *table)
           */
          if (child->top_attach != (child->bottom_attach - 1))
            {
+             GtkRequisition child_requisition;
+
+             gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
              /* Check and see if there is already enough space
               *  for the child.
               */
@@ -1050,9 +1061,9 @@ gtk_table_size_request_pass3 (GtkTable *table)
               *  its requisition, then divide up the needed space evenly
               *  amongst the columns it spans.
               */
-             if (height < child->widget->requisition.height + child->ypadding * 2)
+             if (height < child_requisition.height + child->ypadding * 2)
                {
-                 height = child->widget->requisition.height + child->ypadding * 2 - height;
+                 height = child_requisition.height + child->ypadding * 2 - height;
                  
                  for (row = child->top_attach; row < child->bottom_attach; row++)
                    {
@@ -1454,6 +1465,9 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
       
       if (GTK_WIDGET_VISIBLE (child->widget))
        {
+         GtkRequisition child_requisition;
+         gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
          x = GTK_WIDGET (table)->allocation.x + GTK_CONTAINER (table)->border_width;
          y = GTK_WIDGET (table)->allocation.y + GTK_CONTAINER (table)->border_width;
          max_width = 0;
@@ -1492,7 +1506,7 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
            }
          else
            {
-             allocation.width = child->widget->requisition.width;
+             allocation.width = child_requisition.width;
              allocation.x = x + (max_width - allocation.width) / 2;
            }
          
@@ -1503,7 +1517,7 @@ gtk_table_size_allocate_pass2 (GtkTable *table)
            }
          else
            {
-             allocation.height = child->widget->requisition.height;
+             allocation.height = child_requisition.height;
              allocation.y = y + (max_height - allocation.height) / 2;
            }
          
index 546c3e4256d8b174e709ca2bd81aafcfbc3302a2..f57412184fc5d046727fc37fc6e3aeb901fb5575 100644 (file)
@@ -389,6 +389,7 @@ gtk_toolbar_size_request (GtkWidget      *widget,
   gint nbuttons;
   gint button_maxw, button_maxh;
   gint widget_maxw, widget_maxh;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_TOOLBAR (widget));
@@ -423,11 +424,11 @@ gtk_toolbar_size_request (GtkWidget      *widget,
        case GTK_TOOLBAR_CHILD_TOGGLEBUTTON:
          if (GTK_WIDGET_VISIBLE (child->widget))
            {
-             gtk_widget_size_request (child->widget, &child->widget->requisition);
+             gtk_widget_size_request (child->widget, &child_requisition);
 
              nbuttons++;
-             button_maxw = MAX (button_maxw, child->widget->requisition.width);
-             button_maxh = MAX (button_maxh, child->widget->requisition.height);
+             button_maxw = MAX (button_maxw, child_requisition.width);
+             button_maxh = MAX (button_maxh, child_requisition.height);
            }
 
          break;
@@ -435,15 +436,15 @@ gtk_toolbar_size_request (GtkWidget      *widget,
        case GTK_TOOLBAR_CHILD_WIDGET:
          if (GTK_WIDGET_VISIBLE (child->widget))
            {
-             gtk_widget_size_request (child->widget, &child->widget->requisition);
+             gtk_widget_size_request (child->widget, &child_requisition);
 
-             widget_maxw = MAX (widget_maxw, child->widget->requisition.width);
-             widget_maxh = MAX (widget_maxh, child->widget->requisition.height);
+             widget_maxw = MAX (widget_maxw, child_requisition.width);
+             widget_maxh = MAX (widget_maxh, child_requisition.height);
 
              if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
-               requisition->width += child->widget->requisition.width;
+               requisition->width += child_requisition.width;
              else
-               requisition->height += child->widget->requisition.height;
+               requisition->height += child_requisition.height;
            }
 
          break;
@@ -477,6 +478,7 @@ gtk_toolbar_size_allocate (GtkWidget     *widget,
   GtkToolbarChild *child;
   GtkToolbarChildSpace *child_space;
   GtkAllocation alloc;
+  GtkRequisition child_requisition;
   gint border_width;
 
   g_return_if_fail (widget != NULL);
@@ -545,20 +547,22 @@ gtk_toolbar_size_allocate (GtkWidget     *widget,
          if (!GTK_WIDGET_VISIBLE (child->widget))
            break;
 
-         alloc.width = child->widget->requisition.width;
-         alloc.height = child->widget->requisition.height;
+         gtk_widget_get_child_requisition (child->widget, &child_requisition);
+         
+         alloc.width = child_requisition.width;
+         alloc.height = child_requisition.height;
 
          if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
-           alloc.y = allocation->y + (allocation->height - child->widget->requisition.height) / 2;
+           alloc.y = allocation->y + (allocation->height - child_requisition.height) / 2;
          else
-           alloc.x = allocation->x + (allocation->width - child->widget->requisition.width) / 2;
+           alloc.x = allocation->x + (allocation->width - child_requisition.width) / 2;
 
          gtk_widget_size_allocate (child->widget, &alloc);
 
          if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
-           alloc.x += child->widget->requisition.width;
+           alloc.x += child_requisition.width;
          else
-           alloc.y += child->widget->requisition.height;
+           alloc.y += child_requisition.height;
 
          break;
 
index 6b1eb162e96bfd77ce489ed07e31eab4a1b6ef92..6c5670202503fc2edc4948248800aaff00bd5fdf 100644 (file)
@@ -939,7 +939,10 @@ gtk_tree_size_allocate (GtkWidget     *widget,
          
          if (GTK_WIDGET_VISIBLE (child))
            {
-             child_allocation.height = child->requisition.height;
+             GtkRequisition child_requisition;
+             gtk_widget_get_child_requisition (child, &child_requisition);
+             
+             child_allocation.height = child_requisition.height;
              
              gtk_widget_size_allocate (child, &child_allocation);
              
@@ -965,6 +968,7 @@ gtk_tree_size_request (GtkWidget      *widget,
   GtkTree *tree;
   GtkWidget *child, *subtree;
   GList *children;
+  GtkRequisition child_requisition;
   
   
   g_return_if_fail (widget != NULL);
@@ -983,20 +987,20 @@ gtk_tree_size_request (GtkWidget      *widget,
       
       if (GTK_WIDGET_VISIBLE (child))
        {
-         gtk_widget_size_request (child, &child->requisition);
+         gtk_widget_size_request (child, &child_requisition);
          
-         requisition->width = MAX (requisition->width, child->requisition.width);
-         requisition->height += child->requisition.height;
+         requisition->width = MAX (requisition->width, child_requisition.width);
+         requisition->height += child_requisition.height;
          
          if((subtree = GTK_TREE_ITEM(child)->subtree) &&
             GTK_WIDGET_VISIBLE (subtree))
            {
-             gtk_widget_size_request (subtree, &subtree->requisition);
+             gtk_widget_size_request (subtree, &child_requisition);
              
              requisition->width = MAX (requisition->width, 
-                                       subtree->requisition.width);
+                                       child_requisition.width);
              
-             requisition->height += subtree->requisition.height;
+             requisition->height += child_requisition.height;
            }
        }
     }
index 4ac5c362fd4c6fb0a3e25866bab3c369360b56d7..72ad78aee51614cd995977e83538d06c389b4fc3 100644 (file)
@@ -485,6 +485,7 @@ gtk_tree_item_size_request (GtkWidget      *widget,
 {
   GtkBin *bin;
   GtkTreeItem* item;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_TREE_ITEM (widget));
@@ -499,16 +500,16 @@ gtk_tree_item_size_request (GtkWidget      *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
+      gtk_widget_size_request (bin->child, &child_requisition);
 
-      requisition->width += bin->child->requisition.width;
+      requisition->width += child_requisition.width;
 
       gtk_widget_size_request (item->pixmaps_box, 
                               &item->pixmaps_box->requisition);
       requisition->width += item->pixmaps_box->requisition.width + DEFAULT_DELTA + 
        GTK_TREE(widget->parent)->current_indent;
 
-      requisition->height += MAX (bin->child->requisition.height,
+      requisition->height += MAX (child_requisition.height,
                                  item->pixmaps_box->requisition.height);
     }
 }
index a4b8d031f9719b1e1ea412d0a016109414a7ed77..b5c2e9e3ba2e5bb94f9833ac0f015bcc41d0ba47 100644 (file)
@@ -89,6 +89,7 @@ gtk_vbox_size_request (GtkWidget      *widget,
 {
   GtkBox *box;
   GtkBoxChild *child;
+  GtkRequisition child_requisition;
   GList *children;
   gint nvis_children;
   gint height;
@@ -110,19 +111,19 @@ gtk_vbox_size_request (GtkWidget      *widget,
 
       if (GTK_WIDGET_VISIBLE (child->widget))
        {
-         gtk_widget_size_request (child->widget, &child->widget->requisition);
+         gtk_widget_size_request (child->widget, &child_requisition);
 
          if (box->homogeneous)
            {
-             height = child->widget->requisition.height + child->padding * 2;
+             height = child_requisition.height + child->padding * 2;
              requisition->height = MAX (requisition->height, height);
            }
          else
            {
-             requisition->height += child->widget->requisition.height + child->padding * 2;
+             requisition->height += child_requisition.height + child->padding * 2;
            }
 
-         requisition->width = MAX (requisition->width, child->widget->requisition.width);
+         requisition->width = MAX (requisition->width, child_requisition.width);
 
          nvis_children += 1;
        }
@@ -189,7 +190,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
        }
       else if (nexpand_children > 0)
        {
-         height = (gint)allocation->height - (gint)widget->requisition.height;
+         height = (gint) allocation->height - (gint) widget->requisition.height;
          extra = height / nexpand_children;
        }
       else
@@ -200,7 +201,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
 
       y = allocation->y + GTK_CONTAINER (box)->border_width;
       child_allocation.x = allocation->x + GTK_CONTAINER (box)->border_width;
-      child_allocation.width = MAX (1, (gint)allocation->width - (gint)GTK_CONTAINER (box)->border_width * 2);
+      child_allocation.width = MAX (1, (gint) allocation->width - (gint) GTK_CONTAINER (box)->border_width * 2);
 
       children = box->children;
       while (children)
@@ -222,7 +223,10 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
                }
              else
                {
-                 child_height = child->widget->requisition.height + child->padding * 2;
+                 GtkRequisition child_requisition;
+
+                 gtk_widget_get_child_requisition (child->widget, &child_requisition);
+                 child_height = child_requisition.height + child->padding * 2;
 
                  if (child->expand)
                    {
@@ -243,7 +247,10 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
                }
              else
                {
-                 child_allocation.height = child->widget->requisition.height;
+                 GtkRequisition child_requisition;
+
+                 gtk_widget_get_child_requisition (child->widget, &child_requisition);
+                 child_allocation.height = child_requisition.height;
                  child_allocation.y = y + (child_height - child_allocation.height) / 2;
                }
 
@@ -263,6 +270,9 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
 
          if ((child->pack == GTK_PACK_END) && GTK_WIDGET_VISIBLE (child->widget))
            {
+             GtkRequisition child_requisition;
+             gtk_widget_get_child_requisition (child->widget, &child_requisition);
+
               if (box->homogeneous)
                 {
                   if (nvis_children == 1)
@@ -275,7 +285,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
                 }
               else
                 {
-                 child_height = child->widget->requisition.height + child->padding * 2;
+                 child_height = child_requisition.height + child->padding * 2;
 
                   if (child->expand)
                     {
@@ -296,7 +306,7 @@ gtk_vbox_size_allocate (GtkWidget     *widget,
                 }
               else
                 {
-                  child_allocation.height = child->widget->requisition.height;
+                 child_allocation.height = child_requisition.height;
                   child_allocation.y = y + (child_height - child_allocation.height) / 2 - child_height;
                 }
 
index 6964206fe17845c772b5ab8134eafbb23533d590..271e6dc39cd952d731702a25f7cbdbc37dea9af2 100644 (file)
@@ -637,6 +637,7 @@ gtk_viewport_size_request (GtkWidget      *widget,
 {
   GtkViewport *viewport;
   GtkBin *bin;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_VIEWPORT (widget));
@@ -653,9 +654,9 @@ gtk_viewport_size_request (GtkWidget      *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
-      requisition->width += bin->child->requisition.width;
-      requisition->height += bin->child->requisition.height;
+      gtk_widget_size_request (bin->child, &child_requisition);
+      requisition->width += child_requisition.width;
+      requisition->height += child_requisition.height;
     }
 }
 
@@ -719,8 +720,11 @@ gtk_viewport_size_allocate (GtkWidget     *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
+      GtkRequisition child_requisition;
+      gtk_widget_get_child_requisition (bin->child, &child_requisition);
+      
       viewport->hadjustment->lower = 0;
-      viewport->hadjustment->upper = MAX (bin->child->requisition.width,
+      viewport->hadjustment->upper = MAX (child_requisition.width,
                                          child_allocation.width);
 
       hval = CLAMP (hval, 0,
@@ -728,7 +732,7 @@ gtk_viewport_size_allocate (GtkWidget     *widget,
                    viewport->hadjustment->page_size);
 
       viewport->vadjustment->lower = 0;
-      viewport->vadjustment->upper = MAX (bin->child->requisition.height,
+      viewport->vadjustment->upper = MAX (child_requisition.height,
                                          child_allocation.height);
 
       vval = CLAMP (vval, 0,
index 15cdc04e295762229a45604705870695535ccf9a..105257c0b304f622576f98dcecb46875ed53bab3 100644 (file)
@@ -96,6 +96,7 @@ gtk_vpaned_size_request (GtkWidget      *widget,
                         GtkRequisition *requisition)
 {
   GtkPaned *paned;
+  GtkRequisition child_requisition;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_VPANED (widget));
@@ -107,19 +108,18 @@ gtk_vpaned_size_request (GtkWidget      *widget,
 
   if (paned->child1 && GTK_WIDGET_VISIBLE (paned->child1))
     {
-      gtk_widget_size_request (paned->child1, &paned->child1->requisition);
+      gtk_widget_size_request (paned->child1, &child_requisition);
 
-      requisition->height = paned->child1->requisition.height;
-      requisition->width = paned->child1->requisition.width;
+      requisition->height = child_requisition.height;
+      requisition->width = child_requisition.width;
     }
 
   if (paned->child2 && GTK_WIDGET_VISIBLE (paned->child2))
     {
-      gtk_widget_size_request (paned->child2, &paned->child2->requisition);
+      gtk_widget_size_request (paned->child2, &child_requisition);
 
-      requisition->width = MAX (requisition->width,
-                               paned->child2->requisition.width);
-      requisition->height += paned->child2->requisition.height;
+      requisition->width = MAX (requisition->width, child_requisition.width);
+      requisition->height += child_requisition.height;
     }
 
   requisition->height += GTK_CONTAINER (paned)->border_width * 2 + paned->gutter_size;
@@ -131,6 +131,8 @@ gtk_vpaned_size_allocate (GtkWidget     *widget,
                          GtkAllocation *allocation)
 {
   GtkPaned *paned;
+  GtkRequisition child1_requisition;
+  GtkRequisition child2_requisition;
   GtkAllocation child1_allocation;
   GtkAllocation child2_allocation;
   GdkRectangle old_groove_rectangle;
@@ -145,12 +147,22 @@ gtk_vpaned_size_allocate (GtkWidget     *widget,
   paned = GTK_PANED (widget);
   border_width = GTK_CONTAINER (widget)->border_width;
 
+  if (paned->child1)
+    gtk_widget_get_child_requisition (paned->child1, &child1_requisition);
+  else
+    child1_requisition.height = 0;
+
+  if (paned->child2)
+    gtk_widget_get_child_requisition (paned->child2, &child2_requisition);
+  else
+    child2_requisition.height = 0;
+    
   gtk_paned_compute_position (paned,
                              widget->allocation.height
                                - paned->gutter_size
                                - 2 * border_width,
-                             paned->child1 ? paned->child1->requisition.height : 0,
-                             paned->child2 ? paned->child2->requisition.height : 0);
+                             child1_requisition.height,
+                             child2_requisition.height);
 
   /* Move the handle before the children so we don't get extra expose events */
 
index b1d507340d1e1b13a4b39c3d79880d3533232190..09794e0d8849704e69c2609540d919084e9a246d 100644 (file)
@@ -2346,15 +2346,44 @@ void
 gtk_widget_size_request (GtkWidget     *widget,
                         GtkRequisition *requisition)
 {
-  GtkWidgetAuxInfo *aux_info;
-
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
+#ifdef G_ENABLE_DEBUG
+  if (!GTK_WIDGET_TOPLEVEL (widget) && (requisition == &widget->requisition))
+    g_warning ("gtk_widget_size_request() called on child widget with widget equal\n to widget->requisition. gtk_widget_set_usize() may not work properly.");
+#endif /* G_ENABLE_DEBUG */
+
   gtk_widget_ref (widget);
   gtk_widget_ensure_style (widget);
   gtk_signal_emit (GTK_OBJECT (widget), widget_signals[SIZE_REQUEST],
-                  requisition);
+                  &widget->requisition);
+
+  if (requisition)
+    gtk_widget_get_child_requisition (widget, requisition);
+
+  gtk_widget_unref (widget);
+}
+
+/*****************************************
+ * gtk_widget_get_requesition:
+ *
+ *   arguments:
+ *
+ *   results:
+ *****************************************/
+
+void
+gtk_widget_get_child_requisition (GtkWidget       *widget,
+                           GtkRequisition *requisition)
+{
+  GtkWidgetAuxInfo *aux_info;
+
+  g_return_if_fail (widget != NULL);
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  *requisition = widget->requisition;
+  
   aux_info = gtk_object_get_data_by_id (GTK_OBJECT (widget), aux_info_key_id);
   if (aux_info)
     {
@@ -2363,7 +2392,6 @@ gtk_widget_size_request (GtkWidget        *widget,
       if (aux_info->height > 0)
        requisition->height = aux_info->height;
     }
-  gtk_widget_unref (widget);
 }
 
 /*****************************************
@@ -3462,7 +3490,7 @@ gtk_widget_set_style_internal (GtkWidget *widget,
          GtkRequisition old_requisition;
          
          old_requisition = widget->requisition;
-         gtk_widget_size_request (widget, &widget->requisition);
+         gtk_widget_size_request (widget, NULL);
          
          if ((old_requisition.width != widget->requisition.width) ||
              (old_requisition.height != widget->requisition.height))
index ac08a6ed9582876655e2edf8267da279ba341911..c5478952231ca22a44db03161447f317a54c6d51 100644 (file)
@@ -456,6 +456,8 @@ void           gtk_widget_size_request        (GtkWidget           *widget,
                                           GtkRequisition      *requisition);
 void      gtk_widget_size_allocate       (GtkWidget           *widget,
                                           GtkAllocation       *allocation);
+void       gtk_widget_get_child_requisition     (GtkWidget            *widget,
+                                          GtkRequisition      *requisition);
 void      gtk_widget_add_accelerator     (GtkWidget           *widget,
                                           const gchar         *accel_signal,
                                           GtkAccelGroup       *accel_group,
index cff07387978970116c997d8741eb698c02c8b16b..8715ff1aee082f44ed4ae72f125045fa8b5c636a 100644 (file)
@@ -890,10 +890,12 @@ gtk_window_size_request (GtkWidget      *widget,
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {
-      gtk_widget_size_request (bin->child, &bin->child->requisition);
+      GtkRequisition child_requisition;
+      
+      gtk_widget_size_request (bin->child, &child_requisition);
 
-      requisition->width += bin->child->requisition.width;
-      requisition->height += bin->child->requisition.height;
+      requisition->width += child_requisition.width;
+      requisition->height += child_requisition.height;
     }
   else
     {
@@ -1320,7 +1322,7 @@ gtk_window_move_resize (GtkWindow *window)
 
   if (info && info->width > 0)
     {
-      size_changed = size_changed || (width != info->width);
+      size_changed = size_changed || (width != info->last_width);
       info->last_width = width;
       new_width = info->width;
     }
@@ -1332,7 +1334,7 @@ gtk_window_move_resize (GtkWindow *window)
 
   if (info && info->height > 0)
     {
-      size_changed = size_changed || (height != info->height);
+      size_changed = size_changed || (height != info->last_height);
       info->last_height = height;
       new_height = info->height;
     }
index d76e0666ab943296c33f8d332c6c90da54470ce0..baced40a84d1b8d044769a90e2dcc7c71fc6aacb 100644 (file)
@@ -1571,7 +1571,7 @@ create_handle_box (void)
     gtk_widget_show (label);
 
     handle_box = gtk_handle_box_new ();
-    gtk_container_add (GTK_CONTAINER (hbox), handle_box);
+    gtk_box_pack_start (GTK_BOX (hbox), handle_box, FALSE, FALSE, 0);
     gtk_signal_connect (GTK_OBJECT (handle_box),
                        "child_attached",
                        GTK_SIGNAL_FUNC (handle_box_child_signal),
@@ -1588,7 +1588,7 @@ create_handle_box (void)
     gtk_widget_show (toolbar);
 
     handle_box = gtk_handle_box_new ();
-    gtk_container_add (GTK_CONTAINER (hbox), handle_box);
+    gtk_box_pack_start (GTK_BOX (hbox), handle_box, FALSE, FALSE, 0);
     gtk_signal_connect (GTK_OBJECT (handle_box),
                        "child_attached",
                        GTK_SIGNAL_FUNC (handle_box_child_signal),
index d76e0666ab943296c33f8d332c6c90da54470ce0..baced40a84d1b8d044769a90e2dcc7c71fc6aacb 100644 (file)
@@ -1571,7 +1571,7 @@ create_handle_box (void)
     gtk_widget_show (label);
 
     handle_box = gtk_handle_box_new ();
-    gtk_container_add (GTK_CONTAINER (hbox), handle_box);
+    gtk_box_pack_start (GTK_BOX (hbox), handle_box, FALSE, FALSE, 0);
     gtk_signal_connect (GTK_OBJECT (handle_box),
                        "child_attached",
                        GTK_SIGNAL_FUNC (handle_box_child_signal),
@@ -1588,7 +1588,7 @@ create_handle_box (void)
     gtk_widget_show (toolbar);
 
     handle_box = gtk_handle_box_new ();
-    gtk_container_add (GTK_CONTAINER (hbox), handle_box);
+    gtk_box_pack_start (GTK_BOX (hbox), handle_box, FALSE, FALSE, 0);
     gtk_signal_connect (GTK_OBJECT (handle_box),
                        "child_attached",
                        GTK_SIGNAL_FUNC (handle_box_child_signal),